package com.atguigu.gmallpublisher.mapper;

import com.atguigu.gmallpublisher.bean.ProvinceStats;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/2/20 11:59
 */
public interface ProvinceStatsMapper {
    //按地区查询交易额
    @Select(
        "select " +
            "   province_name," +
            "   sum(order_amount) order_amount " +
            "from province_stats_2021 " +
            "where toYYYYMMDD(stt)=#{date} " +
            "group by province_id, province_name  ")
    List<ProvinceStats> selectProvinceStats(int date);
}
